# -*- coding: utf-8 -*-

# SoftBankウェブコードとSoftbank-UTF8バイナリとのマッピング
# 参考 http://creation.mb.softbank.jp/web/web_pic_06.html

# format("0x%03X", Rack::Ketai::Carrier::Softbank::Filter::WEBCODE_TO_EMOJI['G!'])
#   => [0xE001]].pack('U*') (男の子)

module Rack
  module Ketai
    module Carrier
      class Softbank
        class Filter
          WEBCODE_TO_EMOJI = {
            'G!' => [0xE001].pack('U*'),
            'G"' => [0xE002].pack('U*'),
            'G#' => [0xE003].pack('U*'),
            'G$' => [0xE004].pack('U*'),
            'G%' => [0xE005].pack('U*'),
            'G&' => [0xE006].pack('U*'),
            'G\'' => [0xE007].pack('U*'),
            'G(' => [0xE008].pack('U*'),
            'G)' => [0xE009].pack('U*'),
            'G*' => [0xE00A].pack('U*'),
            'G+' => [0xE00B].pack('U*'),
            'G,' => [0xE00C].pack('U*'),
            'G-' => [0xE00D].pack('U*'),
            'G.' => [0xE00E].pack('U*'),
            'G/' => [0xE00F].pack('U*'),
            'G0' => [0xE010].pack('U*'),
            'G1' => [0xE011].pack('U*'),
            'G2' => [0xE012].pack('U*'),
            'G3' => [0xE013].pack('U*'),
            'G4' => [0xE014].pack('U*'),
            'G5' => [0xE015].pack('U*'),
            'G6' => [0xE016].pack('U*'),
            'G7' => [0xE017].pack('U*'),
            'G8' => [0xE018].pack('U*'),
            'G9' => [0xE019].pack('U*'),
            'G:' => [0xE01A].pack('U*'),
            'G;' => [0xE01B].pack('U*'),
            'G<' => [0xE01C].pack('U*'),
            'G=' => [0xE01D].pack('U*'),
            'G>' => [0xE01E].pack('U*'),
            'G?' => [0xE01F].pack('U*'),
            'G@' => [0xE020].pack('U*'),
            'GA' => [0xE021].pack('U*'),
            'GB' => [0xE022].pack('U*'),
            'GC' => [0xE023].pack('U*'),
            'GD' => [0xE024].pack('U*'),
            'GE' => [0xE025].pack('U*'),
            'GF' => [0xE026].pack('U*'),
            'GG' => [0xE027].pack('U*'),
            'GH' => [0xE028].pack('U*'),
            'GI' => [0xE029].pack('U*'),
            'GJ' => [0xE02A].pack('U*'),
            'GK' => [0xE02B].pack('U*'),
            'GL' => [0xE02C].pack('U*'),
            'GM' => [0xE02D].pack('U*'),
            'GN' => [0xE02E].pack('U*'),
            'GO' => [0xE02F].pack('U*'),
            'GP' => [0xE030].pack('U*'),
            'GQ' => [0xE031].pack('U*'),
            'GR' => [0xE032].pack('U*'),
            'GS' => [0xE033].pack('U*'),
            'GT' => [0xE034].pack('U*'),
            'GU' => [0xE035].pack('U*'),
            'GV' => [0xE036].pack('U*'),
            'GW' => [0xE037].pack('U*'),
            'GX' => [0xE038].pack('U*'),
            'GY' => [0xE039].pack('U*'),
            'GZ' => [0xE03A].pack('U*'),
            'G[' => [0xE03B].pack('U*'),
            'G\\' => [0xE03C].pack('U*'),
            'G]' => [0xE03D].pack('U*'),
            'G^' => [0xE03E].pack('U*'),
            'G_' => [0xE03F].pack('U*'),
            'G`' => [0xE040].pack('U*'),
            'Ga' => [0xE041].pack('U*'),
            'Gb' => [0xE042].pack('U*'),
            'Gc' => [0xE043].pack('U*'),
            'Gd' => [0xE044].pack('U*'),
            'Ge' => [0xE045].pack('U*'),
            'Gf' => [0xE046].pack('U*'),
            'Gg' => [0xE047].pack('U*'),
            'Gh' => [0xE048].pack('U*'),
            'Gi' => [0xE049].pack('U*'),
            'Gj' => [0xE04A].pack('U*'),
            'Gk' => [0xE04B].pack('U*'),
            'Gl' => [0xE04C].pack('U*'),
            'Gm' => [0xE04D].pack('U*'),
            'Gn' => [0xE04E].pack('U*'),
            'Go' => [0xE04F].pack('U*'),
            'Gp' => [0xE050].pack('U*'),
            'Gq' => [0xE051].pack('U*'),
            'Gr' => [0xE052].pack('U*'),
            'Gs' => [0xE053].pack('U*'),
            'Gt' => [0xE054].pack('U*'),
            'Gu' => [0xE055].pack('U*'),
            'Gv' => [0xE056].pack('U*'),
            'Gw' => [0xE057].pack('U*'),
            'Gx' => [0xE058].pack('U*'),
            'Gy' => [0xE059].pack('U*'),
            'Gz' => [0xE05A].pack('U*'),
            'E!' => [0xE101].pack('U*'),
            'E"' => [0xE102].pack('U*'),
            'E#' => [0xE103].pack('U*'),
            'E$' => [0xE104].pack('U*'),
            'E%' => [0xE105].pack('U*'),
            'E&' => [0xE106].pack('U*'),
            'E\'' => [0xE107].pack('U*'),
            'E(' => [0xE108].pack('U*'),
            'E)' => [0xE109].pack('U*'),
            'E*' => [0xE10A].pack('U*'),
            'E+' => [0xE10B].pack('U*'),
            'E,' => [0xE10C].pack('U*'),
            'E-' => [0xE10D].pack('U*'),
            'E.' => [0xE10E].pack('U*'),
            'E/' => [0xE10F].pack('U*'),
            'E0' => [0xE110].pack('U*'),
            'E1' => [0xE111].pack('U*'),
            'E2' => [0xE112].pack('U*'),
            'E3' => [0xE113].pack('U*'),
            'E4' => [0xE114].pack('U*'),
            'E5' => [0xE115].pack('U*'),
            'E6' => [0xE116].pack('U*'),
            'E7' => [0xE117].pack('U*'),
            'E8' => [0xE118].pack('U*'),
            'E9' => [0xE119].pack('U*'),
            'E:' => [0xE11A].pack('U*'),
            'E;' => [0xE11B].pack('U*'),
            'E<' => [0xE11C].pack('U*'),
            'E=' => [0xE11D].pack('U*'),
            'E>' => [0xE11E].pack('U*'),
            'E?' => [0xE11F].pack('U*'),
            'E@' => [0xE120].pack('U*'),
            'EA' => [0xE121].pack('U*'),
            'EB' => [0xE122].pack('U*'),
            'EC' => [0xE123].pack('U*'),
            'ED' => [0xE124].pack('U*'),
            'EE' => [0xE125].pack('U*'),
            'EF' => [0xE126].pack('U*'),
            'EG' => [0xE127].pack('U*'),
            'EH' => [0xE128].pack('U*'),
            'EI' => [0xE129].pack('U*'),
            'EJ' => [0xE12A].pack('U*'),
            'EK' => [0xE12B].pack('U*'),
            'EL' => [0xE12C].pack('U*'),
            'EM' => [0xE12D].pack('U*'),
            'EN' => [0xE12E].pack('U*'),
            'EO' => [0xE12F].pack('U*'),
            'EP' => [0xE130].pack('U*'),
            'EQ' => [0xE131].pack('U*'),
            'ER' => [0xE132].pack('U*'),
            'ES' => [0xE133].pack('U*'),
            'ET' => [0xE134].pack('U*'),
            'EU' => [0xE135].pack('U*'),
            'EV' => [0xE136].pack('U*'),
            'EW' => [0xE137].pack('U*'),
            'EX' => [0xE138].pack('U*'),
            'EY' => [0xE139].pack('U*'),
            'EZ' => [0xE13A].pack('U*'),
            'E[' => [0xE13B].pack('U*'),
            'E\\' => [0xE13C].pack('U*'),
            'E]' => [0xE13D].pack('U*'),
            'E^' => [0xE13E].pack('U*'),
            'E_' => [0xE13F].pack('U*'),
            'E`' => [0xE140].pack('U*'),
            'Ea' => [0xE141].pack('U*'),
            'Eb' => [0xE142].pack('U*'),
            'Ec' => [0xE143].pack('U*'),
            'Ed' => [0xE144].pack('U*'),
            'Ee' => [0xE145].pack('U*'),
            'Ef' => [0xE146].pack('U*'),
            'Eg' => [0xE147].pack('U*'),
            'Eh' => [0xE148].pack('U*'),
            'Ei' => [0xE149].pack('U*'),
            'Ej' => [0xE14A].pack('U*'),
            'Ek' => [0xE14B].pack('U*'),
            'El' => [0xE14C].pack('U*'),
            'Em' => [0xE14D].pack('U*'),
            'En' => [0xE14E].pack('U*'),
            'Eo' => [0xE14F].pack('U*'),
            'Ep' => [0xE150].pack('U*'),
            'Eq' => [0xE151].pack('U*'),
            'Er' => [0xE152].pack('U*'),
            'Es' => [0xE153].pack('U*'),
            'Et' => [0xE154].pack('U*'),
            'Eu' => [0xE155].pack('U*'),
            'Ev' => [0xE156].pack('U*'),
            'Ew' => [0xE157].pack('U*'),
            'Ex' => [0xE158].pack('U*'),
            'Ey' => [0xE159].pack('U*'),
            'Ez' => [0xE15A].pack('U*'),
            'F!' => [0xE201].pack('U*'),
            'F"' => [0xE202].pack('U*'),
            'F#' => [0xE203].pack('U*'),
            'F$' => [0xE204].pack('U*'),
            'F%' => [0xE205].pack('U*'),
            'F&' => [0xE206].pack('U*'),
            'F\'' => [0xE207].pack('U*'),
            'F(' => [0xE208].pack('U*'),
            'F)' => [0xE209].pack('U*'),
            'F*' => [0xE20A].pack('U*'),
            'F+' => [0xE20B].pack('U*'),
            'F,' => [0xE20C].pack('U*'),
            'F-' => [0xE20D].pack('U*'),
            'F.' => [0xE20E].pack('U*'),
            'F/' => [0xE20F].pack('U*'),
            'F0' => [0xE210].pack('U*'),
            'F1' => [0xE211].pack('U*'),
            'F2' => [0xE212].pack('U*'),
            'F3' => [0xE213].pack('U*'),
            'F4' => [0xE214].pack('U*'),
            'F5' => [0xE215].pack('U*'),
            'F6' => [0xE216].pack('U*'),
            'F7' => [0xE217].pack('U*'),
            'F8' => [0xE218].pack('U*'),
            'F9' => [0xE219].pack('U*'),
            'F:' => [0xE21A].pack('U*'),
            'F;' => [0xE21B].pack('U*'),
            'F<' => [0xE21C].pack('U*'),
            'F=' => [0xE21D].pack('U*'),
            'F>' => [0xE21E].pack('U*'),
            'F?' => [0xE21F].pack('U*'),
            'F@' => [0xE220].pack('U*'),
            'FA' => [0xE221].pack('U*'),
            'FB' => [0xE222].pack('U*'),
            'FC' => [0xE223].pack('U*'),
            'FD' => [0xE224].pack('U*'),
            'FE' => [0xE225].pack('U*'),
            'FF' => [0xE226].pack('U*'),
            'FG' => [0xE227].pack('U*'),
            'FH' => [0xE228].pack('U*'),
            'FI' => [0xE229].pack('U*'),
            'FJ' => [0xE22A].pack('U*'),
            'FK' => [0xE22B].pack('U*'),
            'FL' => [0xE22C].pack('U*'),
            'FM' => [0xE22D].pack('U*'),
            'FN' => [0xE22E].pack('U*'),
            'FO' => [0xE22F].pack('U*'),
            'FP' => [0xE230].pack('U*'),
            'FQ' => [0xE231].pack('U*'),
            'FR' => [0xE232].pack('U*'),
            'FS' => [0xE233].pack('U*'),
            'FT' => [0xE234].pack('U*'),
            'FU' => [0xE235].pack('U*'),
            'FV' => [0xE236].pack('U*'),
            'FW' => [0xE237].pack('U*'),
            'FX' => [0xE238].pack('U*'),
            'FY' => [0xE239].pack('U*'),
            'FZ' => [0xE23A].pack('U*'),
            'F[' => [0xE23B].pack('U*'),
            'F\\' => [0xE23C].pack('U*'),
            'F]' => [0xE23D].pack('U*'),
            'F^' => [0xE23E].pack('U*'),
            'F_' => [0xE23F].pack('U*'),
            'F`' => [0xE240].pack('U*'),
            'Fa' => [0xE241].pack('U*'),
            'Fb' => [0xE242].pack('U*'),
            'Fc' => [0xE243].pack('U*'),
            'Fd' => [0xE244].pack('U*'),
            'Fe' => [0xE245].pack('U*'),
            'Ff' => [0xE246].pack('U*'),
            'Fg' => [0xE247].pack('U*'),
            'Fh' => [0xE248].pack('U*'),
            'Fi' => [0xE249].pack('U*'),
            'Fj' => [0xE24A].pack('U*'),
            'Fk' => [0xE24B].pack('U*'),
            'Fl' => [0xE24C].pack('U*'),
            'Fm' => [0xE24D].pack('U*'),
            'Fn' => [0xE24E].pack('U*'),
            'Fo' => [0xE24F].pack('U*'),
            'Fp' => [0xE250].pack('U*'),
            'Fq' => [0xE251].pack('U*'),
            'Fr' => [0xE252].pack('U*'),
            'Fs' => [0xE253].pack('U*'),
            'O!' => [0xE301].pack('U*'),
            'O"' => [0xE302].pack('U*'),
            'O#' => [0xE303].pack('U*'),
            'O$' => [0xE304].pack('U*'),
            'O%' => [0xE305].pack('U*'),
            'O&' => [0xE306].pack('U*'),
            'O\'' => [0xE307].pack('U*'),
            'O(' => [0xE308].pack('U*'),
            'O)' => [0xE309].pack('U*'),
            'O*' => [0xE30A].pack('U*'),
            'O+' => [0xE30B].pack('U*'),
            'O,' => [0xE30C].pack('U*'),
            'O-' => [0xE30D].pack('U*'),
            'O.' => [0xE30E].pack('U*'),
            'O/' => [0xE30F].pack('U*'),
            'O0' => [0xE310].pack('U*'),
            'O1' => [0xE311].pack('U*'),
            'O2' => [0xE312].pack('U*'),
            'O3' => [0xE313].pack('U*'),
            'O4' => [0xE314].pack('U*'),
            'O5' => [0xE315].pack('U*'),
            'O6' => [0xE316].pack('U*'),
            'O7' => [0xE317].pack('U*'),
            'O8' => [0xE318].pack('U*'),
            'O9' => [0xE319].pack('U*'),
            'O:' => [0xE31A].pack('U*'),
            'O;' => [0xE31B].pack('U*'),
            'O<' => [0xE31C].pack('U*'),
            'O=' => [0xE31D].pack('U*'),
            'O>' => [0xE31E].pack('U*'),
            'O?' => [0xE31F].pack('U*'),
            'O@' => [0xE320].pack('U*'),
            'OA' => [0xE321].pack('U*'),
            'OB' => [0xE322].pack('U*'),
            'OC' => [0xE323].pack('U*'),
            'OD' => [0xE324].pack('U*'),
            'OE' => [0xE325].pack('U*'),
            'OF' => [0xE326].pack('U*'),
            'OG' => [0xE327].pack('U*'),
            'OH' => [0xE328].pack('U*'),
            'OI' => [0xE329].pack('U*'),
            'OJ' => [0xE32A].pack('U*'),
            'OK' => [0xE32B].pack('U*'),
            'OL' => [0xE32C].pack('U*'),
            'OM' => [0xE32D].pack('U*'),
            'ON' => [0xE32E].pack('U*'),
            'OO' => [0xE32F].pack('U*'),
            'OP' => [0xE330].pack('U*'),
            'OQ' => [0xE331].pack('U*'),
            'OR' => [0xE332].pack('U*'),
            'OS' => [0xE333].pack('U*'),
            'OT' => [0xE334].pack('U*'),
            'OU' => [0xE335].pack('U*'),
            'OV' => [0xE336].pack('U*'),
            'OW' => [0xE337].pack('U*'),
            'OX' => [0xE338].pack('U*'),
            'OY' => [0xE339].pack('U*'),
            'OZ' => [0xE33A].pack('U*'),
            'O[' => [0xE33B].pack('U*'),
            'O\\' => [0xE33C].pack('U*'),
            'O]' => [0xE33D].pack('U*'),
            'O^' => [0xE33E].pack('U*'),
            'O_' => [0xE33F].pack('U*'),
            'O`' => [0xE340].pack('U*'),
            'Oa' => [0xE341].pack('U*'),
            'Ob' => [0xE342].pack('U*'),
            'Oc' => [0xE343].pack('U*'),
            'Od' => [0xE344].pack('U*'),
            'Oe' => [0xE345].pack('U*'),
            'Of' => [0xE346].pack('U*'),
            'Og' => [0xE347].pack('U*'),
            'Oh' => [0xE348].pack('U*'),
            'Oi' => [0xE349].pack('U*'),
            'Oj' => [0xE34A].pack('U*'),
            'Ok' => [0xE34B].pack('U*'),
            'Ol' => [0xE34C].pack('U*'),
            'Om' => [0xE34D].pack('U*'),
            'P!' => [0xE401].pack('U*'),
            'P"' => [0xE402].pack('U*'),
            'P#' => [0xE403].pack('U*'),
            'P$' => [0xE404].pack('U*'),
            'P%' => [0xE405].pack('U*'),
            'P&' => [0xE406].pack('U*'),
            'P\'' => [0xE407].pack('U*'),
            'P(' => [0xE408].pack('U*'),
            'P)' => [0xE409].pack('U*'),
            'P*' => [0xE40A].pack('U*'),
            'P+' => [0xE40B].pack('U*'),
            'P,' => [0xE40C].pack('U*'),
            'P-' => [0xE40D].pack('U*'),
            'P.' => [0xE40E].pack('U*'),
            'P/' => [0xE40F].pack('U*'),
            'P0' => [0xE410].pack('U*'),
            'P1' => [0xE411].pack('U*'),
            'P2' => [0xE412].pack('U*'),
            'P3' => [0xE413].pack('U*'),
            'P4' => [0xE414].pack('U*'),
            'P5' => [0xE415].pack('U*'),
            'P6' => [0xE416].pack('U*'),
            'P7' => [0xE417].pack('U*'),
            'P8' => [0xE418].pack('U*'),
            'P9' => [0xE419].pack('U*'),
            'P:' => [0xE41A].pack('U*'),
            'P;' => [0xE41B].pack('U*'),
            'P<' => [0xE41C].pack('U*'),
            'P=' => [0xE41D].pack('U*'),
            'P>' => [0xE41E].pack('U*'),
            'P?' => [0xE41F].pack('U*'),
            'P@' => [0xE420].pack('U*'),
            'PA' => [0xE421].pack('U*'),
            'PB' => [0xE422].pack('U*'),
            'PC' => [0xE423].pack('U*'),
            'PD' => [0xE424].pack('U*'),
            'PE' => [0xE425].pack('U*'),
            'PF' => [0xE426].pack('U*'),
            'PG' => [0xE427].pack('U*'),
            'PH' => [0xE428].pack('U*'),
            'PI' => [0xE429].pack('U*'),
            'PJ' => [0xE42A].pack('U*'),
            'PK' => [0xE42B].pack('U*'),
            'PL' => [0xE42C].pack('U*'),
            'PM' => [0xE42D].pack('U*'),
            'PN' => [0xE42E].pack('U*'),
            'PO' => [0xE42F].pack('U*'),
            'PP' => [0xE430].pack('U*'),
            'PQ' => [0xE431].pack('U*'),
            'PR' => [0xE432].pack('U*'),
            'PS' => [0xE433].pack('U*'),
            'PT' => [0xE434].pack('U*'),
            'PU' => [0xE435].pack('U*'),
            'PV' => [0xE436].pack('U*'),
            'PW' => [0xE437].pack('U*'),
            'PX' => [0xE438].pack('U*'),
            'PY' => [0xE439].pack('U*'),
            'PZ' => [0xE43A].pack('U*'),
            'P[' => [0xE43B].pack('U*'),
            'P\\' => [0xE43C].pack('U*'),
            'P]' => [0xE43D].pack('U*'),
            'P^' => [0xE43E].pack('U*'),
            'P_' => [0xE43F].pack('U*'),
            'P`' => [0xE440].pack('U*'),
            'Pa' => [0xE441].pack('U*'),
            'Pb' => [0xE442].pack('U*'),
            'Pc' => [0xE443].pack('U*'),
            'Pd' => [0xE444].pack('U*'),
            'Pe' => [0xE445].pack('U*'),
            'Pf' => [0xE446].pack('U*'),
            'Pg' => [0xE447].pack('U*'),
            'Ph' => [0xE448].pack('U*'),
            'Pi' => [0xE449].pack('U*'),
            'Pj' => [0xE44A].pack('U*'),
            'Pk' => [0xE44B].pack('U*'),
            'Pl' => [0xE44C].pack('U*'),
            'Q!' => [0xE501].pack('U*'),
            'Q"' => [0xE502].pack('U*'),
            'Q#' => [0xE503].pack('U*'),
            'Q$' => [0xE504].pack('U*'),
            'Q%' => [0xE505].pack('U*'),
            'Q&' => [0xE506].pack('U*'),
            'Q\'' => [0xE507].pack('U*'),
            'Q(' => [0xE508].pack('U*'),
            'Q)' => [0xE509].pack('U*'),
            'Q*' => [0xE50A].pack('U*'),
            'Q+' => [0xE50B].pack('U*'),
            'Q,' => [0xE50C].pack('U*'),
            'Q-' => [0xE50D].pack('U*'),
            'Q.' => [0xE50E].pack('U*'),
            'Q/' => [0xE50F].pack('U*'),
            'Q0' => [0xE510].pack('U*'),
            'Q1' => [0xE511].pack('U*'),
            'Q2' => [0xE512].pack('U*'),
            'Q3' => [0xE513].pack('U*'),
            'Q4' => [0xE514].pack('U*'),
            'Q5' => [0xE515].pack('U*'),
            'Q6' => [0xE516].pack('U*'),
            'Q7' => [0xE517].pack('U*'),
            'Q8' => [0xE518].pack('U*'),
            'Q9' => [0xE519].pack('U*'),
            'Q:' => [0xE51A].pack('U*'),
            'Q;' => [0xE51B].pack('U*'),
            'Q<' => [0xE51C].pack('U*'),
            'Q=' => [0xE51D].pack('U*'),
            'Q>' => [0xE51E].pack('U*'),
            'Q?' => [0xE51F].pack('U*'),
            'Q@' => [0xE520].pack('U*'),
            'QA' => [0xE521].pack('U*'),
            'QB' => [0xE522].pack('U*'),
            'QC' => [0xE523].pack('U*'),
            'QD' => [0xE524].pack('U*'),
            'QE' => [0xE525].pack('U*'),
            'QF' => [0xE526].pack('U*'),
            'QG' => [0xE527].pack('U*'),
            'QH' => [0xE528].pack('U*'),
            'QI' => [0xE529].pack('U*'),
            'QJ' => [0xE52A].pack('U*'),
            'QK' => [0xE52B].pack('U*'),
            'QL' => [0xE52C].pack('U*'),
            'QM' => [0xE52D].pack('U*'),
            'QN' => [0xE52E].pack('U*'),
            'QO' => [0xE52F].pack('U*'),
            'QP' => [0xE530].pack('U*'),
            'QQ' => [0xE531].pack('U*'),
            'QR' => [0xE532].pack('U*'),
            'QS' => [0xE533].pack('U*'),
            'QT' => [0xE534].pack('U*'),
            'QU' => [0xE535].pack('U*'),
            'QV' => [0xE536].pack('U*'),
            'QW' => [0xE537].pack('U*'),
          }

          # 1.8系、1.9系 互換性維持のため
          if RUBY_VERSION >= '1.9.0'
            def EMOJI_TO_EMOJIID.index(val)
              key(val)
            end
          end

        end
      end
    end
  end
end
